package com.op.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * (File)表实体类
 *
 * @author 孤焰
 * @since 2021-10-07 09:43:40
 */
@Data
@NoArgsConstructor
@ApiModel("文件")
public class File implements Serializable {
    private static final long serialVersionUID = 649303785403950906L;

    public File(String bucket, String path, String md5, Long size, String suffix) {
        this.bucket = bucket;
        this.path = path;
        this.md5 = md5;
        this.size = size;
        this.suffix = suffix;
    }

    public File(String bucket, String md5, Long size, String suffix) {
        this.bucket = bucket;
        this.md5 = md5;
        this.size = size;
        this.suffix = suffix;
    }

    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("存储桶")
    private String bucket;

    @ApiModelProperty("文件存储路径")
    private String path;

    @ApiModelProperty("文件io流转换的md5码")
    private String md5;

    @ApiModelProperty("文件大小")
    private Long size;

    @ApiModelProperty("文件后缀名")
    private String suffix;

    @ApiModelProperty("状态 0 - 未启用 1 - 启用")
    private Integer status;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date modifyTime;
}

